/**
 * Created by zhujiaming on 17/5/7.
 */
import React, {Component} from 'react';
import {
    Navigator,
    View,
    StyleSheet
} from 'react-native';
import LoginView from './login/index';
import LoadingDialog from './component/loadingDialog';

export default class Root extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (<View style={styles.container}>
            <Navigator
                initialRoute={{name: 'login', component: LoginView}}
                configureScene={(route) => {
                    return Navigator.SceneConfigs.FloatFromRight;
                }}
                renderScene={(route, navigator) => {
                    let Comp = route.component;
                    return <Comp {...route.params} navigator={navigator}/>
                }}
            />
            <LoadingDialog/>
        </View>);
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
    dialogContainer: {
        position: 'absolute',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        backgroundColor: 'rgba(0, 0, 0, 0.3)',
        flex: 1
    }
});
